home *** CD-ROM | disk | FTP | other *** search
- class classes.fx.AsteroidB
- {
- var size;
- var id;
- var x;
- var y;
- var dir;
- var colorV;
- var clip;
- var xMov;
- var yMov;
- var yank;
- var sizeArray = [[1,3],[4,9],[10,17],[18,23],[24,27]];
- var Name = "asteroidB";
- function AsteroidB(px, py, psize, pdir, pcolorV, pid)
- {
- this.size = psize;
- this.id = pid;
- this.x = px;
- this.y = py;
- this.dir = pdir;
- this.colorV = pcolorV;
- _root.d = _root.d + 1;
- if(_root.level == 3)
- {
- this.clip = _root.attachMovie("asteroidC","asteroidB" + this.id + "Clip",_root.d - 4000);
- }
- else
- {
- this.clip = _root.attachMovie("asteroidB","asteroidB" + this.id + "Clip",_root.d - 4000);
- }
- this.clip.gotoAndStop(this.colorV);
- this.clip.body.gotoAndStop(_root.randRange(this.sizeArray[this.size - 1][0],this.sizeArray[this.size - 1][1]));
- if(this.dir == "U")
- {
- this.xMov = _root.randRange2(this.size - 5,-1 * (this.size - 5));
- this.yMov = _root.randRange2(this.size - 5,0.5);
- }
- else if(this.dir == "D")
- {
- this.xMov = _root.randRange2(this.size - 5,-1 * (this.size - 5));
- this.yMov = _root.randRange2(0.5,-1 * (this.size - 9));
- }
- else if(this.dir == "L")
- {
- this.xMov = _root.randRange2(this.size - 5,0.5);
- this.yMov = _root.randRange2(this.size - 5,-1 * (this.size - 5));
- }
- else
- {
- this.xMov = _root.randRange2(0.5,-1 * (this.size - 5));
- this.yMov = _root.randRange2(this.size - 5,-1 * (this.size - 5));
- }
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.clip._rotation = random(4) * 90;
- }
- function main()
- {
- if(this.x > 1150 || this.x < -150 || this.y < -150 || this.y > 750)
- {
- this.yank = true;
- }
- if(this.yank)
- {
- _root.removeFX("asteroidB" + this.id);
- }
- this.x += this.xMov;
- this.y += this.yMov;
- this.clip._x = this.x;
- this.clip._y = this.y;
- }
- }
-